Skip to content

Conversation

@AlexCharlton
Copy link
Contributor

@AlexCharlton AlexCharlton commented Oct 31, 2024

This PR makes three small changes, all aimed at improving BeagleV-Fire support.

Update documentation

Aside from some minor clarifications, a "Flashing" section was added, since the steps to flash the Fire in a way that's compatible with the Microchip-provided Hart Software Services (HSS) is not readily accomplished with west/make flash. An example of west scripts that are able to flash the Fire can be seen here, but I doubt this ought to live in Zephyr proper.

Change selected UART

In 166b9bf#diff-01f5d360c1043dce50bf74fbb1cc056d2049160741e483f843c19d081c065252R18 the selected UART was changed from uart0 to uart1, presumably to mirror the changes made to the other PolarFire boards. While this makes sense to do for the Icicle kit, from looking at the Fire's schematics, I don't believe any of the UARTs other than uart0 is hooked up to anything.

Expand available RAM

sram0 is a relatively small region of RAM, meant to be used by the HSS (see Linux device tree). I see no reason why sram1 shouldn't occupy the remaining ~2GB present on the Fire. I'm a Zephyr newbie, however, so I'm not sure if there are any reasons why you would want to limit the RAM defined.

@zephyrbot zephyrbot added the platform: BeagleBoard BeagleBoard.org Foundation label Oct 31, 2024
@github-actions
Copy link

Hello @AlexCharlton, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@AlexCharlton AlexCharlton changed the title BeagleV-Fire board improvements boards: beaglev_fire: improve docs, fix uart, expand RAM Oct 31, 2024
@AlexCharlton
Copy link
Contributor Author

Noting that these doc fixes overlap with #79511. My doc additions do cover the flashing instructions which were noted as missing in that PR.

@con-pax
Copy link
Contributor

con-pax commented Oct 31, 2024

Hey @AlexCharlton, thanks for the PR! It all looks good to me. I will test it on the Beagle today.
Cheers

@AlexCharlton
Copy link
Contributor Author

Thanks @con-pax! I should have noted that I tested this out on my Fire, and it Works For Me 🙂

con-pax
con-pax previously approved these changes Nov 1, 2024
Copy link
Contributor

@con-pax con-pax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

6.406446] >> *** Booting Zephyr OS build v4.0.0-rc1-79-g464e68645d7f ***
Hello World! beaglev_fire/polarfire/e51
464e68645d7 (HEAD -> main, origin/main, origin/HEAD) boards: beaglev_fire: expand RAM
pc             0x80000290	0x80000290 <main+24>

@AlexCharlton
Copy link
Contributor Author

In addition to fixing the board identifiers, I caught a serious issue in my change. I only just found the authoritative docs for PolarFire memory layout. And this clearly shows that address 0x8000_0000 has an upper range of 0xC000_0000 (1GB shy of the 2GB desired).

Instead, we need to use addresses in the 64bit range if we want to span more than 1GB. In particular 0x10_0000_0000 is the correct starting point for cached DDR.

To accomplish this, I defined a new node in the device tree for this memory region,beaglev.ddr_cached_high. Unlike previously, I couldn't reuse the soc node because we needed to set the #address-cells to be 2, and doing so would have affected other nodes under soc.

Here you can see hello world booting into the updated address range:

[7.295341] Attempting to select eMMC ... Passed
[8.74206] Preparing to copy from MMC to DDR ...
[8.79596] GPT_PartitionIdToLBAOffset() failed - using offset 0
[8.86540] Attempting to read image header (1632 bytes) ...    
[8.92876] Copying 15456 bytes to 0x103fc00000                      <--------------
[8.98310] MMC: Boot Image registered ...
[8.103127] Boot image passed CRC
[8.107468] Boot image set name: "PolarFire-SoC-HSS::ZephyrTESTImage"
*** Booting Zephyr OS build v3.7.0-4263-ge40fa8914fad ***
Hello World! beaglev_fire/polarfire/u54

@kartben
Copy link
Contributor

kartben commented Nov 21, 2024

@jadonk we still don't have you properly set up as a maintainer, apparently...

In addition to some minor corrections, document the process of flashing
the board.

Signed-off-by: Alex Charlton <[email protected]>
uart1 is not connected to anything as far as I can tell.
uart0 was the previous correctly selected uart, so this changes
back to that.

Signed-off-by: Alex Charlton <[email protected]>
The Fire has 2GB of RAM, so expand sram1 to use it

Signed-off-by: Alex Charlton <[email protected]>
Per PR review.

Signed-off-by: Alex Charlton <[email protected]>
Per the docs, the memory at address 0x80000000 ends at 0xC0000000.
In other words, the address space is 0x40000000, which is only half
of the size we want to map. This means that the upper address space
previously mapped was overlapping with the space reserved for non-cached
memory.

Instead, we map the entire 2GB at 0x1000000000, which is the correct
address for cached DDR that occupies more than 1 GB.

We defined a new node in the device tree for this memory region,
`beaglev.ddr_cached_high`. We did not reuse the `soc` node because
we needed to redefine the `#address-cells` to be 2, and doing so
would have affected other nodes under `soc`.

Signed-off-by: Alex Charlton <[email protected]>
@kartben
Copy link
Contributor

kartben commented Nov 26, 2024

rebased to re-trigger incomplete CI

@kartben kartben merged commit efc2cfe into zephyrproject-rtos:main Nov 27, 2024
19 checks passed
@github-actions
Copy link

Hi @AlexCharlton!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

@kartben kartben linked an issue Dec 9, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: BeagleBoard BeagleBoard.org Foundation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc: Documentation issue in 'boards/beagle/beaglev_fire/doc/index'

6 participants